<?php 
defined('_JEXEC') or die( 'Restricted access' );

class JElementReview extends JElement
{
	function fetchElement($name, $value, &$node, $control_name)
	{
		$db =& JFactory::getDBO();
		
		$query = 'SELECT id, name'
				.' FROM #__reviews'
				.' WHERE published = 1'
				.' ORDER BY name';		
		
		$db->setQuery($query);
		$options = $db->loadObjectList();

		return JHTML::_('select.genericlist',  $options, $control_name. '[' . $name . ']', 'class="inputbox"', 'id', 'name', $value, $control_name . $name );
	}
}